<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="cwb1.Course" %>
<%@ page import="cwb1.DivisionRegistry" %>
<%@ page import="cwb1.UserRegistry" %>
<%@ page import="cwb1.User" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<script type="text/javascript">

function disable() {
	document.getElementById("courseChoice").disabled=true;
	document.getElementById("LearningType").disabled=true;
}

function enable() {
	document.getElementById("courseChoice").disabled=false;
	document.getElementById("LearningType").disabled=false;
}

</script>


<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Aurora - Tracking your studies</title>
</head>
<body>

	<% if(session.getAttribute("id")==null)
        	{
        		String boodschap = "You need to login first.";
        		response.sendRedirect("login.jsp?boodschap=" + boodschap + "&url=" + "TrackingChoice.jsp");
        	}
	%> 


	<p> Choose an activity to be tracked <br/>
	<form name="trackingInput" action="/tracking" method="post">
		<p>
		<select name="activity" id="activityChoice">
			<option value="Sleep" onclick="disable()">Sleep </option>
			<option value="Job" onclick="disable()">Job </option>
			<option value="Night life" onclick="disable()">Night Life </option>
			<option value="Sport" onclick="disable()">Sport </option>
			<option value="Learning" onclick="enable()">Learning </option>
		</select> <br /> <p />
		
		<p>
		<select name="LearningType" id="LearningType" disabled="true">
			<option value="College">College </option>
			<option value="Practice">Practice </option>
			<option value="Study">Study </option>
		</select>
		</p> <br />
		
		<p>
		<select name="course" id="courseChoice" disabled=true>
			<%
			for(Course listCourse: DivisionRegistry.getInstance().getAllUser((String) session.getAttribute("id")) ) {
				%>
				<option value= <%= listCourse.getId() %>> <%=listCourse.getCourseName() %>
				<% 
			}
			%>
		
		</select> <p />
		<input type="hidden" name="userId" value="<%= session.getAttribute("id") %>"  />
		<input type="submit" value="Start Timer" class="button" />
	</form>
	<p /> 



</body>
</html>